import functools
import datetime

def timeit(fn):
    @functools.wraps(fn)
    def wrapper(*arg,**kwargs):
        start = datetime.datetime.now()
        ret = fn(*arg,**kwargs)
        deffer = (datetime.datetime.now() - start).total_seconds()
        return ret,deffer
    return wrapper
